<template>
  <div>
    get instance
    <p>{{name}}</p>
  </div>
</template>

<script>
import {getCurrentInstance, onMounted, reactive, toRefs} from 'vue';
  export default {
    name: 'setUp',
    data() {
      return {
        age:23,
        name: 'jms'
      }
    },
    created() {
      console.log('this2', this.name);
    },
    setup() {
      const data = reactive({
        age:23,
        name: 'jack',
        info: {city: 'jms'}
      })
      console.log('this1', this);
      const instance = getCurrentInstance();
      console.log(`instance`, instance, `name`, instance.proxy.age);
      onMounted(() => {
        console.log(`this3`, instance.proxy.name);
      })
      return {
        ...toRefs(data)
      }
    }
  }
</script>

<style scoped>

</style>